import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/passway/list',
    method: 'post',
    data: query
  })
}

export function deletePassway(query) {
  return request({
    url: '/passway/deletePassway',
    method: 'post',
    data: query
  })
}

export function createPassway(query) {
  return request({
    url: '/passway/createPassway',
    method: 'post',
    data: query
  })
}

export function updatePassway(query) {
  return request({
    url: '/passway/updatePassway',
    method: 'post',
    data: query
  })
}

export function passwayDetail(id) {
  return request({
    url: '/passway/' + id,
    method: 'get',
  })
}

export function selectList(query) {
  return request({
    url: '/passway/list',
    method: 'post',
    data: query
  })
}

//根据停车id获取
export function listAuthPassway(parkId) {
  return request({
    url: '/auth/listAuthPassway/' + parkId,
    method: 'get',
  })
}

//根据停车id获取出入口
export function listAuthPort(parkId) {
  return request({
    url: '/auth/listAuthPort/' + parkId,
    method: 'get',
  })
}

//分页获取出入口
export function crlistAuthPort(data) {
  return request({
    url: '/auth/listAuthPort',
    method: 'post',
    data
  })
}
